package com.cgy.study.config;

import com.cgy.study.service.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * @author 曹光友 2018/6/22 16:07
 */
@Configuration
public class HelloAppConfig {
    private static final Logger logger = LoggerFactory.getLogger(HelloAppConfig.class);

    // 把方法的返回值放到容器中，组件默认的id为方法名
    @Bean
    public HelloService helloService(){
        System.out.println("容器加载组件。。。");
        return  new HelloService();
    }
}